import axios from '@/libs/api.request'

export const login = ({ userName, password,type }) => {
  const data = { userName, password ,type};
  return axios.request({
    url: 'login',
    data,
    method: 'post'
  })
}

export const getUserInfo = (token) => {
  return axios.request({
    url: 'login',
    params: {
      token
    },
    method: 'get'
  })
}

export const logout = (token) => {
  console.log('logou: ' + token);
  return axios.request({
    url: 'login/' + token,
    method: 'delete'
  })
}
